package com.ruoyi.manage.mapper;

import com.ruoyi.manage.domain.Activity;
import com.ruoyi.manage.domain.ActivityUser;
import com.ruoyi.manage.domain.dto.UpdateActivityUserDto;
import com.ruoyi.manage.domain.vo.ActivityUserVo;
import com.ruoyi.manage.domain.vo.EnrollUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author ZhangZhongGen
 */
@Mapper
public interface ActivityUserMapper {

    @Insert("insert into tb_activity_user(activity_id,user_id) values(#{activityId},#{userId})")
    public int insertActivityUser(ActivityUser au);

    @Select("select * from tb_activity_user where activity_id=#{activityId} and user_id=#{userId}")
    ActivityUser selectActivityUserByActivityUser(ActivityUser activityUser);

    @Delete("delete from tb_activity_user where activity_id=#{activityId} and user_id=#{userId}")
    Integer deleteActivityUser(ActivityUser au);

    List<ActivityUser> selectActivityUserList(ActivityUser au);

    List<ActivityUserVo> selectActivityUserVoList(ActivityUser au);

    List<EnrollUser> selectEnrollUserListByActivityId(Long activityId);

    int updateBatchByActivityIdAndUserIds(UpdateActivityUserDto updateActivityUserDto);
}
